package com.clever.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clever.bean.shopping.projo.output.ChatMessageDetailVO;
import org.apache.ibatis.annotations.Mapper;
import com.clever.bean.shopping.ChatMessage;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 聊天记录表Mapper
 *
 * @Author xixi
 * @Date 2024-04-08 11:11:29
 */
@Mapper
public interface ChatMessageMapper extends BaseMapper<ChatMessage> {
    /**
     * 阅读消息
     *
     * @param senderId   发送者id
     * @param receiverId 接收者id
     */
    void readMessage(@Param("senderId") String senderId, @Param("receiverId") String receiverId);

    /**
     * 获取会话消息
     *
     * @param senderId   发送者id
     * @param receiverId 接收者id
     */
    List<ChatMessageDetailVO> selectMessageDetailList(@Param("senderId") String senderId, @Param("receiverId") String receiverId);

    ChatMessageDetailVO selectMessageDetailById(@Param("id") String id);
}
